<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CaseCategory extends Model
{
    use HasFactory;

    public $fillable = [
        'name',
        'pid',
        'orderby',
        'hide'
    ];

    public function children()
    {
        return $this->hasMany(CaseCategory::class, 'pid', 'id');
    }

    public function cases()
    {
        return $this->hasMany(Cases::class);
    }
}
